$(function(){

		//轮播
		var vipTimer = null;
		var vipInit = 0;
		var $vipSbox = $(".vip-club-scrollBox");
		var $vipUl = $vipSbox.find("ul");
		var $vipLi = $vipUl.find("li");
		var $vipL = $vipLi.size();
		var $vipLiWidth = $vipLi.width();
		var $vipSpan = $(".vip-scroll-num span");
		var $vipPrevBtn = $(".vip-prev-btn");
		var $vipNextBtn = $(".vip-next-btn");
			$vipUl.css({"width":$vipL*$vipLiWidth+'px',left:-936+'px'});


			$vipSpan.mouseenter(function(event) {
				var _this = $(this).index();
					vipInit = _this;
					vipImgChange(_this);

			});
			function vipImgChange(obj){
				$vipSpan.eq(obj).addClass('act').siblings().removeClass('act');
				$vipUl.stop().animate({left:-$vipLiWidth*obj-936+'px'}, 600,function(){
					if(obj == $vipL-2){
						$vipUl.css("left",-936);
						$vipSpan.eq(0).addClass('act').siblings().removeClass('act');
						vipInit = 0;
					}
					if(vipInit == -1){
						$vipUl.css("left",-2808);
						$vipSpan.eq(2).addClass('act').siblings().removeClass('act');
						vipInit = 2;
					}
				});
			}
			//上一个
		    $vipPrevBtn.click(function(){
		        vipInit == -1? vipInit=2 : vipInit--;
		        vipImgChange(vipInit);
		    });
		    //下一个
		    $vipNextBtn.click(function(){
		        vipInit>=$vipL-2?vipInit=0:vipInit++;
		        vipImgChange(vipInit);
		    });

		    vipImgAutoMove();
		    //自动轮播
		    function vipImgAutoMove(){
		        clearTimeout(vipTimer);
		        vipTimer = setTimeout(function(){
		            vipInit>=$vipL-1?vipInit=0:vipInit++;
		            vipImgChange(vipInit);
		            vipImgAutoMove();
		        },3000);
		    }

		    //关闭定时器
		    $vipSbox.hover(function() {
		    	clearTimeout(vipTimer);
		    }, function() {
		    	vipImgAutoMove();
		    });
		    //会员换购
		    var $proLi = $(".vip-pro-list li");
		    	$proLi.hover(function(){
		    		$(this).css('border-color','#ff3f3e');
		    		$(this).find('.inner-box').css('border-color', '#ff3f3e');
		    	},function(){
		    		$(this).css('border-color','#e5e5e5');
		    		$(this).find('.inner-box').css('border-color', '#fff');
		    	});



});